package com.smile.spring;

import com.smile.spring.service.UserService;
import com.smile.spring.service.UserService1;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/12/11 16:39
 */
public class Test {

    public static void main(String[] args) {
       // ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
         AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        UserService userService = (UserService) context.getBean("userService");
        userService.test();
        
        UserService1 userService1 = (UserService1) context.getBean("userService1");
        userService1.test();
    }
}
